

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_BitwiseExclusiveOr_RT : RT_Node
    {
        public RT_SingleValuePort Value1_RT;

        public RT_SingleValuePort Value2_RT;

        public RT_SingleValuePort Result_RT;

        public Node_BitwiseExclusiveOr_RT(Node_BitwiseExclusiveOr sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Value1_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Value1, this);

            Value2_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Value2, this);

            Result_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Result, this);
            Result_RT.OnGetValue = GetResult;
        }

        public AValue GetResult(DAG_Executor executor)
        {
            int i1 = Value1_RT.GetValue(executor).ToInteger().Item2;
            int i2 = Value2_RT.GetValue(executor).ToInteger().Item2;
            int result = i1 ^ i2;
            Result_RT.SourceValue.SetInteger(result);
            return Result_RT.SourceValue;
        }
    }
}